# encoding: UTF-8

Factory.define :user do |f|
  f.sequence(:email) { |n| "user_#{n}@email.com" }
  f.password "123qwe"
  f.default_currency_code "BYR"
end

Factory.define :user_wallet do |u|
  u.association :user
  u.association :wallet
end

Factory.define :wallet do |w|
  w.sequence(:name) { |n| "wallet_#{n}}" }
#  w.association :user_wallet
end

Factory.define :currency do |c|
  c.sequence(:code) { |n| "CU#{n}" }
end

Factory.define :amount do |a|
  a.value 100
  a.association :wallet
  a.association :currency
end

Factory.define :operation do |o|
  o.description "Operations description"
  o.association :user
end

Factory.define :ScheduledRecord do |o|
  o.fromDate Time.now.gmtime.to_i
  o.toDate (Time.now + 1.year).gmtime.to_i
  o.cron "cron or something like cron"
  o.tweetJson "\"json tweet\""
  o.association :wallet
end

Factory.define :tag do |t|
  t.association :wallet
  t.sequence(:name) { |n| "tag_#{n}" }
end

Factory.define :shop do |s|
  s.sequence(:name) { |n| "shop_#{n}}" }
  s.description "My favourite shop brand"
end

Factory.define :shop_address do |a|
  a.sequence(:addr) { |n| "Minsk city the Oxford street house №#{n}}" }
  a.addr_description "first right turn after the Silver Bridge"

  a.association :shop
end

Factory.define :product_tag do |pt|
  pt.sequence(:name) { |n| "pt_#{n}}" }
end

Factory.define :product do |p|
  p.association :product_tag
  p.text { |pr| "My favorite #{pr.product_tag.name}, #{rand(1000)}gr"}
end

Factory.define :shop_product do |sp|
  sp.association :shop_address
  sp.association :product
  sp.price 100
end

Factory.define :wish_list do |i|
  i.association :user
  i.name "default"
end

Factory.define :wish_item do |i|
  i.association :wish_list
  i.association :product

  i.status 0
  i.mark 0
end

Factory.define :user_product do |up|
  up.association :user
  up.association :product

  up.bought_count 0
end

Factory.define :user_shop do |up|
  up.association :user
  up.association :shop_address

  up.visits_count 0
end

Factory.define :CurrencyExchangeRate do |rate|
  rate.sequence(:timestamp) {|n| n*1000 }

end







